import App from "./App";
import uviewPlus from "uview-plus";
import util from "@/common/js/util.js";
import "@/utils/utils";
import myNaveBar from "@/components/myComponents/my-naveBar.vue";
import { initRequest } from "/utils/request/index";
import { createPinia } from "pinia";
import fuiConfig from "@/components/firstui/fui-config/index.js";

import cuCustom from "./colorui/components/cu-custom.vue";

// // #ifdef H5
// import vant from 'vant';
// import 'vant/lib/index.css';
// // #endif

// #ifndef VUE3
import Vue from "vue";
Vue.config.productionTip = false;

App.mpType = "app";

const app = new Vue({
  ...App,
});
app.$mount();
// #endif

// #ifdef VUE3
import { createSSRApp } from "vue";

export function createApp() {
  const app = createSSRApp(App);
  const pinia = createPinia();

  // 引入请求封装
  initRequest(app);
  app.component("myNaveBar", myNaveBar);
  app.use(uviewPlus);
  app.use(pinia);

  // 初始化FirstUI
  app.config.globalProperties.$fui = fuiConfig;

  app.component("cucustom", cuCustom);
  // // #ifdef H5
  // app.use(vant);
  // // #endif

  return {
    app,
  };
}
// #endif
